<template>
  <div class="app-container">
    <el-tabs ref="tabs" v-model="activeName">
      <el-tab-pane name="first">
        <div>
          <el-form style="background-color: white;" :model="queryParams" ref="queryForm" size="small" :inline="true"
                   width="68px">
            <el-form-item style="margin-left: 10px">
              <span style="font-size: 20px">{{ parseInt(parseTime(queryParams.createTime, '{m}')) }} 月</span>
            </el-form-item>
            <el-form-item style="margin-left: 10px">
              <el-date-picker
                v-model="queryParams.createTime"
                :editable="false"
                :clearable="false"
                @change="indexCreateTimeChange"
                value-format="yyyy-MM"
                type="month"
                placeholder="选择月份">
              </el-date-picker>
            </el-form-item>
          </el-form>
          <br>
          <div>
             <span style="font-size: 20px;margin-left: 100px;float: left;margin-top: 16px">
               {{ parseInt(parseTime(queryParams.createTime, '{m}')) }} 月工资汇总表
             </span>

            <el-descriptions :colon="false" class="margin-top"
                             :column="4" direction="vertical">
              <el-descriptions-item label="计薪人数">{{ indexForm.countEmp }} 人</el-descriptions-item>
              <el-descriptions-item label="应发工资"> {{
                  parseFloat(indexForm.sumGrossWage).toFixed(2)
                }}
              </el-descriptions-item>
              <el-descriptions-item label="实发工资"> {{
                  parseFloat(indexForm.sumNetPayroll).toFixed(2)
                }}
              </el-descriptions-item>
              <el-descriptions-item label="个税"> {{
                  parseFloat(indexForm.sumPayTaxesPay).toFixed(2)
                }}
              </el-descriptions-item>
            </el-descriptions>
            <el-button type="text" @click="activeSecond()"
                       style="float: right;font-size: 20px;margin-right: 100px;margin-top: 7px">查看详情
            </el-button>

          </div>

        </div>
      </el-tab-pane>
      <el-tab-pane name="second">
        <div>
          <el-button @click="activeFirst()">返回</el-button>
          <span style="font-size: 20px;margin-left: 20px">{{
              parseTime(queryParams.createTime, '{y}年{m}月')
            }}工资详情单</span>
        </div>
        <el-form style="margin-top: 30px" :model="queryParams" ref="infoQueryForm" size="small" :inline="true"
                 width="68px">
          <el-form-item prop="all">
            <el-input
              v-model="queryParams.all"
              placeholder="支持姓名工号查询"
              clearable
              @keyup.enter.native="allQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" @click="allQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
            <el-button icon="el-icon-s-promotion" @click="payrollAccounting">核算工资</el-button>
          </el-form-item>
        </el-form>
        <div style="position: relative">
          <el-tabs v-model="active" type="card" @tab-click="tabClick" style="width: 100%">
            <el-tab-pane label="月工资明细" name="first">
              <el-table :data="indexCollectList"
                        v-loading="loading"
                        @selection-change="handleSelectionChange" border style="width: 100%">
                <el-table-column fixed align="center" type="selection" width="55"></el-table-column>
                <el-table-column fixed align="center" width="120" prop="empName" label="姓名">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empName === undefined ||scope.row.empName === null">-</span>
                    <span v-else>{{ scope.row.empName }}</span>
                  </template>
                </el-table-column>
                <el-table-column fixed align="center" width="100" prop="jobNo" label="工号">
                  <template slot-scope="scope">
                    <span v-if="scope.row.jobNo === undefined ||scope.row.jobNo === null">-</span>
                    <span v-else>{{ scope.row.jobNo }}</span>
                  </template>
                </el-table-column>
                <el-table-column fixed align="center" width="120" prop="deptName" label="部门">
                  <template slot-scope="scope">
                    <span v-if="scope.row.deptName === undefined ||scope.row.deptName === null">-</span>
                    <span v-else>{{ scope.row.deptName }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务">
                  <template slot-scope="scope">
                    <span v-if="scope.row.positionApplied === undefined ||scope.row.positionApplied === null">-</span>
                    <span v-else>{{ scope.row.positionApplied }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
               <!-- <el-table-column align="center" width="120" :show-overflow-tooltip="true" prop="enterprise"
                                 label="公司">
                  <template slot-scope="scope">
                    <span v-if="scope.row.enterprise === undefined ||scope.row.enterprise === null">-</span>
                    <span v-else>{{ scope.row.enterprise }}</span>
                  </template>
                </el-table-column>-->
                <el-table-column align="center" width="120" prop="workNature" label="工作性质">
                  <template slot-scope="scope">
                    <span v-if="scope.row.workNature === undefined ||scope.row.workNature === null">-</span>
                    <span v-else>{{ scope.row.workNature }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="verifyAgoSalary" label="工资总核对额">
                  <template slot-scope="scope">
                    <span v-if="scope.row.verifyAgoSalary === undefined ||scope.row.verifyAgoSalary === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.verifyAgoSalary).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="basePay" label="基本工资">
                  <template slot-scope="scope">
                    <span v-if="scope.row.basePay === undefined ||scope.row.basePay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.basePay).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="gradePay" label="级别工资">
                  <template slot-scope="scope">
                    <span v-if="scope.row.gradePay === undefined ||scope.row.gradePay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.gradePay).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="meritPay" label="绩效工资">
                  <template slot-scope="scope">
                    <span v-if="scope.row.meritPay === undefined ||scope.row.meritPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.meritPay).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="practicalSalary" label="当月实际工资额">
                  <template slot-scope="scope">
                        <span
                          v-if="scope.row.practicalSalary === undefined ||scope.row.practicalSalary === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.practicalSalary).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="coefficient" label="系数">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span v-if="scope.row.coefficient === undefined ||scope.row.coefficient === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.coefficient).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.cId !== undefined && scope.row.cId !== null && scope.row.status === '0'">
                        <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                  v-model="scope.row.coefficient"></el-input>
                      </span>
                      <span v-else>
                        <span v-if="scope.row.coefficient === undefined ||scope.row.coefficient === null">-</span>
                        <span v-else>{{ parseFloat(scope.row.coefficient).toFixed(2) }}</span>
                      </span>

                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="royaltiesMoney" label="提成">
                  <template slot-scope="scope">

                    <span v-if="scope.row.royaltiesMoney === undefined ||scope.row.royaltiesMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.royaltiesMoney).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="bonus" label="奖金">
                  <template slot-scope="scope">
                    <span v-if="scope.row.bonus === undefined ||scope.row.bonus === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.bonus).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="housingAllowance" label="电脑/住房补贴">
                  <template slot-scope="scope">

                        <span
                          v-if="scope.row.housingAllowance === undefined ||scope.row.housingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.housingAllowance).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="transportationAllowance" label="交通补贴">
                  <template slot-scope="scope">

                       <span
                         v-if="scope.row.transportationAllowance === undefined ||scope.row.transportationAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.transportationAllowance).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="overtime" label="加班补贴">
                  <template slot-scope="scope">

                    <span v-if="scope.row.overtime === undefined ||scope.row.overtime === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.overtime).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="attendanceDeductMoney" label="考勤日扣款">
                  <template slot-scope="scope">

                       <span
                         v-if="scope.row.attendanceDeductMoney === undefined ||scope.row.attendanceDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.attendanceDeductMoney).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="leaveDeductMoney" label="事病假扣款">
                  <template slot-scope="scope">

                       <span
                         v-if="scope.row.leaveDeductMoney === undefined ||scope.row.leaveDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.leaveDeductMoney).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="elseDeductMoney" label="其他扣款">
                  <template slot-scope="scope">

                        <span
                          v-if="scope.row.elseDeductMoney === undefined ||scope.row.elseDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.elseDeductMoney).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfEndowmentInsurance" label="养老保险（个人）">
                  <template slot-scope="scope">

                       <span
                         v-if="scope.row.oneselfEndowmentInsurance === undefined ||scope.row.oneselfEndowmentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfEndowmentInsurance).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfMedicalInsurance" label="医疗保险（个人）">
                  <template slot-scope="scope">

                        <span
                          v-if="scope.row.oneselfMedicalInsurance === undefined ||scope.row.oneselfMedicalInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMedicalInsurance).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfUnemploymentInsurance"
                                 label="失业保险（个人）">
                  <template slot-scope="scope">

                       <span
                         v-if="scope.row.oneselfUnemploymentInsurance === undefined ||scope.row.oneselfUnemploymentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfUnemploymentInsurance).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfMaternityInsurance"
                                 label="生育保险（个人）">
                  <template slot-scope="scope">

                        <span
                          v-if="scope.row.oneselfMaternityInsurance === undefined ||scope.row.oneselfMaternityInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMaternityInsurance).toFixed(2) }}</span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfInjuryInsurance"
                                 label="工伤保险（个人）">
                  <template slot-scope="scope">
                        <span
                          v-if="scope.row.oneselfInjuryInsurance === undefined ||scope.row.oneselfInjuryInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfInjuryInsurance).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfHousingAllowance"
                                 label="住房公积金（个人）">
                  <template slot-scope="scope">

                        <span
                          v-if="scope.row.oneselfHousingAllowance === undefined ||scope.row.oneselfHousingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfHousingAllowance).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="180" prop="amountInTotal" label="社保公积金合计（个人）">
                  <template slot-scope="scope">

                    <span v-if="scope.row.amountInTotal === undefined ||scope.row.amountInTotal === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.amountInTotal).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="payTaxesPay" label="个税">
                  <template slot-scope="scope">

                    <span v-if="scope.row.payTaxesPay === undefined ||scope.row.payTaxesPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.payTaxesPay).toFixed(2) }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="grossWage" label="应发工资">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                       <span v-if="scope.row.grossWage === undefined ||scope.row.grossWage === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.grossWage).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.cId !== undefined && scope.row.cId !== null && scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.grossWage"></el-input>
                      </span>
                      <span v-else>
                          <span v-if="scope.row.grossWage === undefined ||scope.row.grossWage === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.grossWage).toFixed(2) }}</span>
                      </span>
                      </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="netPayroll" label="实发工资">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                       <span v-if="scope.row.netPayroll === undefined ||scope.row.netPayroll === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.netPayroll).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.cId !== undefined && scope.row.cId !== null && scope.row.status === '0'">
                        <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                  v-model="scope.row.netPayroll"></el-input>
                      </span>
                      <span v-else>
                         <span v-if="scope.row.netPayroll === undefined ||scope.row.netPayroll === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.netPayroll).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" fixed="right" width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
              <pagination
                v-show="indexTotal>0"
                :total="indexTotal"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getList()"
              />
            </el-tab-pane>
            <el-tab-pane label="考勤工时" name="second">
              <el-table height="460"  v-loading="loading" :data="payrollAccountingForm.attendanceCollectList"

                        border
                        style="width: 100%">
                <el-table-column fixed align="center" type="index" width="55"></el-table-column>
                <el-table-column fixed align="center" width="120" prop="empName" label="姓名"></el-table-column>
                <el-table-column fixed align="center" width="100" prop="jobNo" label="工号"></el-table-column>
                <el-table-column fixed  align="center" width="120" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" :show-overflow-tooltip="true" width="120" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" width="120" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
               <!-- <el-table-column align="center" :show-overflow-tooltip="true" width="160" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" width="120" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" width="120" prop="standardDay" label="标准出勤天数">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                         <span v-if="scope.row.standardDay === undefined ||scope.row.standardDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.standardDay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                       <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.standardDay"></el-input>
                       </span>
                      <span v-else>
                         <span v-if="scope.row.standardDay === undefined ||scope.row.standardDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.standardDay).toFixed(2) }}</span>
                      </span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="attendanceDay" label="实际出勤天数">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                         <span v-if="scope.row.attendanceDay === undefined ||scope.row.attendanceDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.attendanceDay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                       <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.attendanceDay"></el-input>
                       </span>
                      <span v-else>
                         <span v-if="scope.row.attendanceDay === undefined ||scope.row.attendanceDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.attendanceDay).toFixed(2) }}</span>
                      </span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="probationPeriodDay" label="试用期出勤天数">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                         <span
                           v-if="scope.row.probationPeriodDay === undefined ||scope.row.probationPeriodDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.probationPeriodDay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                       <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.probationPeriodDay"></el-input>
                       </span>
                      <span v-else>
                         <span
                           v-if="scope.row.probationPeriodDay === undefined ||scope.row.probationPeriodDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.probationPeriodDay).toFixed(2) }}</span>
                      </span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="officialPeriodDay" label="转正出勤天数">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                         <span
                           v-if="scope.row.officialPeriodDay === undefined ||scope.row.officialPeriodDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.officialPeriodDay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                       <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.officialPeriodDay"></el-input>
                       </span>
                      <span v-else>
                         <span
                           v-if="scope.row.officialPeriodDay === undefined ||scope.row.officialPeriodDay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.officialPeriodDay).toFixed(2) }}</span>
                      </span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="overtime" label="加班补贴">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                         <span v-if="scope.row.overtime === undefined ||scope.row.overtime === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.overtime).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                       <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.overtime"></el-input>
                       </span>
                      <span v-else>
                         <span v-if="scope.row.overtime === undefined ||scope.row.overtime === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.overtime).toFixed(2) }}</span>
                      </span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="attendanceDeductMoney" label="考勤日扣款">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                       <span
                         v-if="scope.row.attendanceDeductMoney === undefined ||scope.row.attendanceDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.attendanceDeductMoney).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.attendanceDeductMoney"></el-input>
                      </span>
                      <span v-else>
                         <span
                           v-if="scope.row.attendanceDeductMoney === undefined ||scope.row.attendanceDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.attendanceDeductMoney).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="leaveDeductMoney" label="事病假扣款">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                       <span
                         v-if="scope.row.leaveDeductMoney === undefined ||scope.row.leaveDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.leaveDeductMoney).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.leaveDeductMoney"></el-input>
                      </span>
                      <span v-else>
                         <span
                           v-if="scope.row.leaveDeductMoney === undefined ||scope.row.leaveDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.leaveDeductMoney).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="elseDeductMoney" label="其他扣款">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.elseDeductMoney === undefined ||scope.row.elseDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.elseDeductMoney).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.elseDeductMoney"></el-input>
                      </span>
                      <span v-else>
                           <span
                             v-if="scope.row.elseDeductMoney === undefined ||scope.row.elseDeductMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.elseDeductMoney).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center"  width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="绩效工资" name="third">
              <el-table height="460" :data="payrollAccountingForm.performanceCollectList"
                        border
                        v-loading="loading"
                        style="width: 100%">
                <el-table-column  align="center" type="index" width="55"></el-table-column>
                <el-table-column align="center" prop="empName" label="姓名"></el-table-column>
                <el-table-column  align="center" prop="jobNo" label="工号"></el-table-column>
                <el-table-column align="center" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" width="120" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
               <!-- <el-table-column align="center" width="160" :show-overflow-tooltip="true" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" prop="meritPay" label="绩效工资">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.meritPay === undefined ||scope.row.meritPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.meritPay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.meritPay"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.meritPay === undefined ||scope.row.meritPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.meritPay).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="补贴扣款" name="fourth">
              <el-table v-loading="loading" :data="payrollAccountingForm.subsidyCollectList"
                        border height="460"
                        style="width: 100%">
                <el-table-column  align="center" type="index" width="55"></el-table-column>
                <el-table-column  align="center" width="120" prop="empName" label="姓名"></el-table-column>
                <el-table-column  align="center" width="100" prop="jobNo" label="工号"></el-table-column>
                <el-table-column  align="center" width="120" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" width="120" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" width="120" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
                <!--<el-table-column align="center" width="160" :show-overflow-tooltip="true" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" width="120" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" prop="bonus" label="奖金">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.bonus === undefined ||scope.row.bonus === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.bonus).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.bonus"></el-input>
                      </span>
                      <span v-else>
                           <span
                             v-if="scope.row.bonus === undefined ||scope.row.bonus === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.bonus).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" prop="housingAllowance" label="住房补贴">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.housingAllowance === undefined ||scope.row.housingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.housingAllowance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.housingAllowance"></el-input>
                      </span>
                      <span v-else>
                           <span
                             v-if="scope.row.housingAllowance === undefined ||scope.row.housingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.housingAllowance).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" prop="transportationAllowance" label="交通补贴">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.transportationAllowance === undefined ||scope.row.transportationAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.transportationAllowance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.transportationAllowance"></el-input>
                      </span>
                      <span v-else>
                           <span
                             v-if="scope.row.transportationAllowance === undefined ||scope.row.transportationAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.transportationAllowance).toFixed(2) }}</span>
                      </span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center"  width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="社保公积金" name="fifth">
              <el-table v-loading="loading" :data="payrollAccountingForm.socialSecurityCollectList"
                        height="460"
                        border
                        style="width: 100%">
                <el-table-column fixed align="center" type="index" width="55"></el-table-column>
                <el-table-column fixed align="center" width="120" prop="empName" label="姓名"></el-table-column>
                <el-table-column fixed align="center" width="100" prop="jobNo" label="工号"></el-table-column>
                <el-table-column fixed align="center" width="120" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" width="120" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" width="120" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
                <!--<el-table-column align="center" width="160" :show-overflow-tooltip="true" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" width="120" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" width="140" prop="oneselfEndowmentInsurance" label="养老保险（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfEndowmentInsurance === undefined ||scope.row.oneselfEndowmentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfEndowmentInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfEndowmentInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfEndowmentInsurance === undefined ||scope.row.oneselfEndowmentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfEndowmentInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfMedicalInsurance" label="医疗保险（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfMedicalInsurance === undefined ||scope.row.oneselfMedicalInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMedicalInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfMedicalInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfMedicalInsurance === undefined ||scope.row.oneselfMedicalInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMedicalInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfUnemploymentInsurance" label="失业保险（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfUnemploymentInsurance === undefined ||scope.row.oneselfUnemploymentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfUnemploymentInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfUnemploymentInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfUnemploymentInsurance === undefined ||scope.row.oneselfUnemploymentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfUnemploymentInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfMaternityInsurance" label="生育保险（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfMaternityInsurance === undefined ||scope.row.oneselfMaternityInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMaternityInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfMaternityInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfMaternityInsurance === undefined ||scope.row.oneselfMaternityInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfMaternityInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfInjuryInsurance" label="工伤保险（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfInjuryInsurance === undefined ||scope.row.oneselfInjuryInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfInjuryInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfInjuryInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfInjuryInsurance === undefined ||scope.row.oneselfInjuryInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfInjuryInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="oneselfHousingAllowance" label="住房公积金（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfHousingAllowance === undefined ||scope.row.oneselfHousingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfHousingAllowance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfHousingAllowance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfHousingAllowance === undefined ||scope.row.oneselfHousingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfHousingAllowance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="180" prop="oneselfSum" label="社保公积金合计（个人）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.oneselfSum === undefined ||scope.row.oneselfSum === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfSum).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.oneselfSum"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.oneselfSum === undefined ||scope.row.oneselfSum === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.oneselfSum).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyEndowmentInsurance" label="养老保险（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyEndowmentInsurance === undefined ||scope.row.companyEndowmentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyEndowmentInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyEndowmentInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyEndowmentInsurance === undefined ||scope.row.companyEndowmentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyEndowmentInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyMedicalInsurance" label="医疗保险（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyMedicalInsurance === undefined ||scope.row.companyMedicalInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyMedicalInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyMedicalInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyMedicalInsurance === undefined ||scope.row.companyMedicalInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyMedicalInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyUnemploymentInsurance" label="失业保险（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyUnemploymentInsurance === undefined ||scope.row.companyUnemploymentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyUnemploymentInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyUnemploymentInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyUnemploymentInsurance === undefined ||scope.row.companyUnemploymentInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyUnemploymentInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyMaternityInsurance" label="生育保险（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyMaternityInsurance === undefined ||scope.row.companyMaternityInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyMaternityInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyMaternityInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyMaternityInsurance === undefined ||scope.row.companyMaternityInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyMaternityInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyInjuryInsurance" label="工伤保险（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyInjuryInsurance === undefined ||scope.row.companyInjuryInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyInjuryInsurance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyInjuryInsurance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyInjuryInsurance === undefined ||scope.row.companyInjuryInsurance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyInjuryInsurance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="140" prop="companyHousingAllowance" label="住房公积金（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companyHousingAllowance === undefined ||scope.row.companyHousingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyHousingAllowance).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companyHousingAllowance"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companyHousingAllowance === undefined ||scope.row.companyHousingAllowance === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companyHousingAllowance).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center" width="180" prop="companySum" label="社保公积金合计（企业）">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.companySum === undefined ||scope.row.companySum === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companySum).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.companySum"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.companySum === undefined ||scope.row.companySum === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.companySum).toFixed(2) }}</span></span>
                    </span>

                  </template>
                </el-table-column>
                <el-table-column align="center"  width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="提成" name="sixth">
              <el-table v-loading="loading" :data="payrollAccountingForm.royaltiesCollectList"
                        height="460"
                        border
                        style="width: 100%">
                <el-table-column align="center" type="index" width="55"></el-table-column>
                <el-table-column  align="center" prop="empName" label="姓名"></el-table-column>
                <el-table-column  align="center" prop="jobNo" label="工号"></el-table-column>
                <el-table-column  align="center" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
                <!--<el-table-column align="center" :show-overflow-tooltip="true" width="160" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" prop="royaltiesMoney" label="提成金额">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.royaltiesMoney === undefined ||scope.row.royaltiesMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.royaltiesMoney).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.royaltiesMoney"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.royaltiesMoney === undefined ||scope.row.royaltiesMoney === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.royaltiesMoney).toFixed(2) }}</span></span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center"  width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="个税" name="seventh">
              <el-table v-loading="loading" :data="payrollAccountingForm.taxCollectList"
                        border
                        height="460"
                        style="width: 100%">
                <el-table-column  align="center" type="index" width="55"></el-table-column>
                <el-table-column  align="center" prop="empName" label="姓名"></el-table-column>
                <el-table-column  align="center" prop="jobNo" label="工号"></el-table-column>
                <el-table-column  align="center" prop="deptName" label="部门"></el-table-column>
                <el-table-column align="center" :show-overflow-tooltip="true" prop="positionApplied"
                                 label="职务"></el-table-column>
                <el-table-column align="center" prop="empStatus" label="员工状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.empStatus === 3">试用</span>
                    <span v-if="scope.row.empStatus === 4">正式</span>
                    <span v-if="scope.row.empStatus === 6">离职</span>
                  </template>
                </el-table-column>
               <!-- <el-table-column align="center" :show-overflow-tooltip="true" width="160" prop="enterprise"
                                 label="公司"></el-table-column>-->
                <el-table-column align="center" width="120" prop="workNature" label="工作性质"></el-table-column>
                <el-table-column align="center" prop="payTaxesPay" label="纳税金额">
                  <template slot-scope="scope">
                     <span v-if="editIndexVisible === false">
                        <span
                          v-if="scope.row.payTaxesPay === undefined ||scope.row.payTaxesPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.payTaxesPay).toFixed(2) }}</span>
                    </span>
                    <span v-if="editIndexVisible === true">
                      <span
                        v-if="scope.row.status === '0'">
                      <el-input oninput="value=value.replace(/[^0-9.]/g,'')"
                                v-model="scope.row.payTaxesPay"></el-input>
                      </span>
                      <span v-else><span
                        v-if="scope.row.payTaxesPay === undefined ||scope.row.payTaxesPay === null">-</span>
                    <span v-else>{{ parseFloat(scope.row.payTaxesPay).toFixed(2) }}</span></span>
                    </span>
                  </template>
                </el-table-column>
                <el-table-column align="center" width="120" prop="status" label="状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.status === '0'" type="info">未上传</el-tag>
                    <el-tag v-if="scope.row.status === '1'" type="success">已上传</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
          </el-tabs>
          <div style="position: absolute;right: 10px;top: 5px">
            <div v-if="editIndexVisible === false">
              <el-button type="text" v-if="active === 'first'" @click="batchUploading" style="font-size: 15px">批量上传工资表
              </el-button>
              <el-button type="text" @click="exportExcel()" style="font-size: 15px">导出</el-button>
              <el-button type="text" @click="editIndex()" style="font-size: 15px">批量修改</el-button>
            </div>
            <div v-if="editIndexVisible === true">
              <el-button type="text" @click="submitIndex" style="font-size: 15px">保存</el-button>
              <el-button type="text" @click="closeIndex()" style="font-size: 15px">取消</el-button>
            </div>
          </div>
        </div>

      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import {
    list, indexCreateTimeChange,
    attendanceList,
    performanceList,
    subsidyList,
    socialSecurityList,
    royaltiesList,
    taxList,
    updateIndex,
    updateAttendance,
    updatePerformance,
    updateSubsidy,
    updateSocialSecurity,
    updateRoyalties,
    updateTax,
    payrollAccounting,
    updateStatus
  } from '@/api/system/collect'

  Date.prototype.format = function (fmt) {
    var o = {
      "M+": this.getMonth() + 1, //月份
      "d+": this.getDate(), //日
      "h+": this.getHours(), //小时
      "m+": this.getMinutes(), //分
      "s+": this.getSeconds(), //秒
      "q+": Math.floor((this.getMonth() + 3) / 3), //季度
      "S": this.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt)) {
      fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    for (var k in o) {
      if (new RegExp("(" + k + ")").test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
      }
    }
    return fmt;
  }
  export default {
    name: "emolumentStatement",
    data() {
      return {
        activeName: 'first',
        active: 'first',
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          createTime: new Date(new Date()).format("yyyy-MM-dd"),
          all: ''
        },
        infoParams: {
          pageNum: 1,
          pageSize: 10,
        },
        selections: [],
        indexForm: {
          countEmp: 0,
          sumGrossWage: 0.00,
          sumNetPayroll: 0.00,
          sumPayTaxesPay: 0.00,
        },
        indexCollectList: [],
        indexTotal: 0,
        editIndexVisible: false,
        loading: false,
        payrollAccountingForm: {
          attendanceCollectList: [],
          performanceCollectList: [],
          subsidyCollectList: [],
          socialSecurityCollectList: [],
          royaltiesCollectList: [],
          taxCollectList: [],
        }
      }
    },
    created() {
      this.indexCreateTimeChange();
    },
    methods: {
      batchUploading() {
        if (this.selections.length > 0) {
          this.$confirm('是否确认上传工资表', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            updateStatus(this.selections).then(res => {
              this.$message({
                type: 'success',
                message: '上传成功'
              });
              this.allQuery()
            })
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消'
            });
          });
        } else {
          this.$message({
            type: 'warning',
            message: '请选择至少一名人员!'
          });
        }
      },
      payrollAccounting() {
        this.$confirm('是否确认核算' + new Date(this.queryParams.createTime).format("yyyy年MM月") + '工资？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const loading = this.$loading({
            lock: true,
            text: '正在核算，请稍等！',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
          });
          payrollAccounting(this.payrollAccountingForm).then(res => {
            loading.close();
            this.$message({
              type: 'success',
              message: '已核算!'
            });
            this.active = 'first'
            this.allQuery()
          }).catch(e => {
            loading.close();
            this.active = 'first'
            this.allQuery()
          })
        }).catch(() => {
          loading.close();
          this.allQuery()
          this.$message({
            type: 'info',
            message: '已取消'
          });
        });
      },
      exportExcel() {
        if (this.active === 'first') {
          this.download('/system/collect/indexExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `工资明细汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'second') {
          this.download('/system/collect/attendanceExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `考勤工时汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'third') {
          this.download('/system/collect/performanceExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `绩效工资汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'fourth') {
          this.download('/system/collect/subsidyExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `补贴扣款汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'fifth') {
          this.download('/system/collect/socialSecurityExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `社保公积金汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'sixth') {
          this.download('/system/collect/royaltiesExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `提成汇总${new Date().getTime()}.xlsx`)
        } else if (this.active === 'seventh') {
          this.download('/system/collect/taxExport', {
            ...this.queryParams
          }, new Date(this.queryParams.createTime).format("yyyy年MM月") + `个人所得税汇总${new Date().getTime()}.xlsx`)
        }
      },
      tabClick() {
        this.editIndexVisible = false
        this.queryParams.all = ''
        this.queryParams.pageNum = 1
        if (this.active === 'first') {
          this.getList()
        } else if (this.active === 'second') {
          this.attendanceList()
        } else if (this.active === 'third') {
          this.performanceList()
        } else if (this.active === 'fourth') {
          this.subsidyList()
        } else if (this.active === 'fifth') {
          this.socialSecurityList()
        } else if (this.active === 'sixth') {
          this.royaltiesList()
        } else if (this.active === 'seventh') {
          this.taxList()
        }
      },
      submitIndex() {
        this.$confirm('是否确认修改？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          if (this.active === 'first') {
            updateIndex(this.indexCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'second') {
            updateAttendance(this.payrollAccountingForm.attendanceCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'third') {
            updatePerformance(this.payrollAccountingForm.performanceCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'fourth') {
            updateSubsidy(this.payrollAccountingForm.subsidyCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'fifth') {
            updateSocialSecurity(this.payrollAccountingForm.socialSecurityCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'sixth') {
            updateRoyalties(this.payrollAccountingForm.royaltiesCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          } else if (this.active === 'seventh') {
            updateTax(this.payrollAccountingForm.taxCollectList).then(res => {
              this.editIndexVisible = false
              this.allQuery()
              this.$message({
                type: 'success',
                message: '修改成功!'
              });
            })
          }
        }).catch(() => {
          this.allQuery()
          this.$message({
            type: 'info',
            message: '已取消修改'
          });
        });
      },
      closeIndex() {
        this.editIndexVisible = false
        this.allQuery()
      },
      editIndex() {
        this.editIndexVisible = true
      },
      indexCreateTimeChange() {
        indexCreateTimeChange(this.queryParams).then(res => {
          if (res.data.countEmp !== undefined && res.data.countEmp !== null) {
            this.indexForm.countEmp = res.data.countEmp
          } else {
            this.indexForm.countEmp = 0
          }
          if (res.data.sumGrossWage !== undefined && res.data.sumGrossWage !== null) {
            this.indexForm.sumGrossWage = res.data.sumGrossWage
          } else {
            this.indexForm.sumGrossWage = 0.00
          }
          if (res.data.sumNetPayroll !== undefined && res.data.sumNetPayroll !== null) {
            this.indexForm.sumNetPayroll = res.data.sumNetPayroll
          } else {
            this.indexForm.sumNetPayroll = 0.00
          }
          if (res.data.sumPayTaxesPay !== undefined && res.data.sumPayTaxesPay !== null) {
            this.indexForm.sumPayTaxesPay = res.data.sumPayTaxesPay
          } else {
            this.indexForm.sumPayTaxesPay = 0.00
          }
        })
      },
      handleSelectionChange(val) {
        this.selections = val.map(c => c.cId)
      },
      //月汇总
      getList() {
        this.loading = true
        list(this.queryParams).then(res => {
          this.indexCollectList = res.rows
          this.indexTotal = res.total
          this.loading = false
        })
      },
      // 考勤汇总
      attendanceList() {
        this.loading = true
        attendanceList(this.queryParams).then(res => {
          this.payrollAccountingForm.attendanceCollectList = res.data
          this.loading = false
        })
      },
      // 绩效汇总
      performanceList() {
        this.loading = true
        performanceList(this.queryParams).then(res => {
          this.payrollAccountingForm.performanceCollectList = res.data
          this.loading = false
        })
      },
      // 奖金汇总
      subsidyList() {
        this.loading = true
        subsidyList(this.queryParams).then(res => {
          this.payrollAccountingForm.subsidyCollectList = res.data
          this.loading = false
        })
      },
      // 社保公积金汇总
      socialSecurityList() {
        this.loading = true
        socialSecurityList(this.queryParams).then(res => {
          this.payrollAccountingForm.socialSecurityCollectList = res.data
          this.loading = false
        })
      },
      // 提成汇总
      royaltiesList() {
        this.loading = true
        royaltiesList(this.queryParams).then(res => {
          this.payrollAccountingForm.royaltiesCollectList = res.data
          this.loading = false
        })
      },
      // 个税汇总
      taxList() {
        this.loading = true
        taxList(this.queryParams).then(res => {
          this.payrollAccountingForm.taxCollectList = res.data
          this.loading = false
        })
      },
      allQuery() {
        this.queryParams.pageNum = 1
        if (this.active === 'first') {
          this.getList()
        } else if (this.active === 'second') {
          this.attendanceList()
        } else if (this.active === 'third') {
          this.performanceList()
        } else if (this.active === 'fourth') {
          this.subsidyList()
        } else if (this.active === 'fifth') {
          this.socialSecurityList()
        } else if (this.active === 'sixth') {
          this.royaltiesList()
        } else if (this.active === 'seventh') {
          this.taxList()
        }
      },
      resetQuery() {
        this.queryParams.all = ''
        this.allQuery()
      },
      activeFirst() {
        this.activeName = 'first'
        this.indexCollectList = []
        this.payrollAccountingForm.attendanceCollectList = []
        this.payrollAccountingForm.performanceCollectList = []
        this.payrollAccountingForm.subsidyCollectList = []
        this.payrollAccountingForm.socialSecurityCollectList = []
        this.payrollAccountingForm.royaltiesCollectList = []
        this.payrollAccountingForm.taxCollectList = []
        this.indexCreateTimeChange();
      },
      activeSecond() {
        this.activeName = 'second'
        this.getList()
        this.attendanceList()
        this.performanceList()
        this.subsidyList()
        this.socialSecurityList()
        this.royaltiesList()
        this.taxList()
      }
    },
    mounted() {
      //tab标签的权限控制
      this.$nextTick(() => {
        //首先把所有的都隐藏
        this.$refs.tabs.$children[0].$refs.tabs[0].style.display = 'none';
        this.$refs.tabs.$children[0].$refs.tabs[1].style.display = 'none';
      });
    }
  }
</script>

<style scoped>
  .margin-top {
    float: left;
    width: 750px;
    margin-left: 100px;
    font-size: 18px;
  }

  .box-bottom {
    margin-top: 50px;
    background-color: white
  }
</style>
